package com.chen.module.testproducerconsumer;

/**
 * create by chen on 2020/4/14 19:35
 * Email:chenshaopeng90@hotmail.com
 */
public class TestQueue {
    public static void main(String[] args) {
        test();
    }

    private static void test() {
        CenterControl centerControl = CenterControl.getInstance();
        centerControl.putMsg(new MessageBean(1));
        centerControl.putMsg(new MessageBean(2));
        centerControl.putMsg(new MessageBean(3));
        centerControl.putMsg(new MessageBean(4));
        centerControl.putMsg(new MessageBean(5));

        try {
            Thread.sleep(5_000);
            centerControl.weekUpThread();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private static void test2() {
        CenterControl centerControl = CenterControl.getInstance();
        centerControl.putMsg2(new MessageBean(1));
        centerControl.putMsg2(new MessageBean(2));
        centerControl.putMsg2(new MessageBean(3));
        centerControl.putMsg2(new MessageBean(4));
        centerControl.putMsg2(new MessageBean(5));
        try {
            Thread.sleep(5_000);
            centerControl.weekUpThread2();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
